package com.lhdx.practical.service.impl;

import com.lhdx.practical.bean.MenuConfig;
import com.lhdx.practical.dao.MenuConfigDao;
import com.lhdx.practical.service.MenuConfigService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service("MenuConfigService")
public class MenuConfigServiceImpl implements MenuConfigService {
    @Autowired
    private MenuConfigDao menuConfigDao;

    @Override
    public void save(MenuConfig menuConfig) {
        menuConfigDao.save(menuConfig);
    }

    @Override
    public List<MenuConfig> findAllByGradeid(long gradeid) {
        return menuConfigDao.findAllByGradeid(gradeid);
    }

    @Override
    public List<MenuConfig> findAllByPersonid(long personid) {
        return menuConfigDao.findAllByPersonid(personid);
    }

    @Override
    public List<MenuConfig> findAllByPersonidAndGradeid(long personid, long gradeid) {
        return menuConfigDao.findAllByPersonidAndGradeid(personid,gradeid);
    }

    @Override
    public MenuConfig findByGradeidAndMenuid(long gradeid,long menuid) {
        return menuConfigDao.findByGradeidAndMenuid(gradeid,menuid);
    }

    @Override
    public void deleteAllByGradeid(long gradeid) {
        menuConfigDao.deleteAllByGradeid(gradeid);
    }
}
